﻿Imports Entidades
Public Class frmAñadirAdministrador
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim admin As Administrador
        If txtUsuario.Text = "" Then
            MessageBox.Show("Falta usuario")
            Exit Sub
        End If
        If txtContraseña.Text = "" Then
            MessageBox.Show("Falta contraseña")
            Exit Sub
        End If
        admin = New Administrador(txtUsuario.Text, txtContraseña.Text)
        Dim st As String = miGestion.añadirAdministrador(admin)
        If st <> "" Then
            MessageBox.Show(st)
            Exit Sub
        End If
        MessageBox.Show("Administrador registrado con éxito")
        Me.Close()
        miAdmin = miGestion.obtenerAdministrador

    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        Me.Close()

    End Sub
End Class